<%--
  Created by IntelliJ IDEA.
  User: luiza
  Date: 09/09/12
  Time: 17:39
--%>
<%@ include file="/taglibs.jsp"%>

<head>
    <title><fmt:message key="grupo.form.title"/></title>
</head>

<p>Preencha os dados do grupo:</p>

<form:form commandName="grupo" method="post" action="grupoForm" onsubmit="return validateGrupo(this)" id="grupoForm">
    <form:errors path="*" cssClass="error"/>
    <form:hidden path="id"/>
    <table class="detail">

        <tr>
            <th><label for="descricao"><fmt:message key="grupo.descricao"/>:</label></th>
            <td>
                <form:input path="descricao" id="descricao"/>
                <form:errors path="descricao" cssClass="fieldError"/>
            </td>
        </tr>

        <tr>
            <td></td>
            <td>
                <input type="submit" class="button" name="save" value="Salvar"/>
                <c:if test="${not empty param.id}">
                    <security:authorize ifAllGranted="ROLE_ADMIN">
                        <input type="submit" class="button" name="delete" value="Excluir"/>
                    </security:authorize>
                </c:if>
                <input type="submit" class="button" name="cancel" value="Cancelar" onclick="bCancel=true"/>
            </td>
        </tr>
    </table>
</form:form>

<script type="text/javascript">
    Form.focusFirstElement($('grupoForm'));
</script>

<v:javascript formName="grupo" staticJavascript="false" xhtml="true" cdata="false"/>
<script type="text/javascript" src="<c:url value="/scripts/validator.jsp"/>"></script>